﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<Ditto.Models.Comment>" %>

<% using (Html.BeginForm("New", "Comments", new { type = Model.Type, subjectID = Model.SubjectID }))
   {%>
     <%: Html.TextAreaFor(m => Model.Message, new { style = "width:97%;height:auto;padding:7px;margin:7px 0px 7px 0px;overflow:auto;display:block;float:left" })%>
    <div style="float:right;display:block">
        <input id="postcomment" type="submit" value="Post" class="button"/>
    </div>
    <div style="clear:both"></div>
<%}%>

<script src="/Scripts/autoresize.jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
    $("#comments textarea").autoResize({
    // On resize:
    onResize : function() {
        $(this).css({opacity:0.8});
    },
    // After resize:
    animateCallback : function() {
        $(this).css({opacity:1});
    },
    // Quite slow animation:
    animateDuration : 300,
    // More extra space:
    extraSpace : 10
});
</script>